React 部署上 Github pages


Posted by Rich on 2021-09-29

官網教學
我以為我會了,過了幾個禮拜後又忘了要怎麼部署。

  1. 先載個 npm install --save gh-pages
  2. 並在 package.json scripts 下面加這兩行
    "predeploy": "npm run build",
    "deploy": "gh-pages -d build",
    
  3. package.json 還要加上
    "homepage": "https://myusername.github.io/reponame",
  4. 最後 npm run deploy
  5. 去 github setting pages 換成 source gh-pages
  6. 點網址應該就可以看到頁面了









Related Posts

W12_API 自己做 [ BE101 ] 實作之二

W12_API 自己做 [ BE101 ] 實作之二

[JavaScript] ES6 其他好用的新語法

[JavaScript] ES6 其他好用的新語法

CS50 Lec7 - SqLite SameTime Update Error - Transaction

CS50 Lec7 - SqLite SameTime Update Error - Transaction


Comments